#ifndef UC_BRMESH2D_H
#define UC_BRMESH2D_H 1

#include "zadesk.h"
#include "zrxobject.h"
#include "zrxboiler.h"
#include "ucbrgbl.h"
#include "ucbrmesh.h"
#include "ucbrm2dctl.h"


// forward class declarations
class UcBrEntity;
class UcBrMesh2dControl;
class UcBrMesh;
class UcBrMesh2dData;


// these will come from STL in next release
static UcBrMesh2dControl UcBrMesh2dControlDefault;

struct pair {
    UcBrEntity*			first;
    UcBrMesh2dControl	second;
    pair() : first((UcBrEntity*)NULL), second(UcBrMesh2dControlDefault) {}
	pair(const UcBrEntity*& a, const UcBrMesh2dControl& b) : first((UcBrEntity*)a), second(b) {}
};

inline pair
make_pair(const UcBrEntity*& entity, const UcBrMesh2dControl& control)
{ return pair(entity, control); }


// these are temporary typedefs until STL is available
typedef pair value_type;
typedef void iterator;


class DllImpExp UcBrMesh2dFilter
{
public:
	UcBrMesh2dFilter();
    ~UcBrMesh2dFilter();
    
    // Insert
    iterator			insert			(const value_type& x);

private:
    // this is all temporary until STL is available
	friend class UcBrImpMesh2d;

    UcBrMesh2dFilter(const UcBrMesh2dFilter& src);
    UcBrMesh2dFilter&	operator =      (const UcBrMesh2dFilter& src);

    value_type			mKeyValuePair;
};


class DllImpExp UcBrMesh2d : public UcBrMesh
{
public:
    UCRX_DECLARE_MEMBERS(UcBrMesh2d);
    UcBrMesh2d();
    UcBrMesh2d(const UcBrMesh2d& src);
    ~UcBrMesh2d();
    
    // Assignment operator
    UcBrMesh2d&         operator =      (const UcBrMesh2d& src);

    // Queries & Initialisers
    UcBr::ErrorStatus   set				(UcBrMesh2dData* mesh2d);
	UcBr::ErrorStatus	get				(UcBrMesh2dData*& mesh2d) const;

    // Mesh generation
    UcBr::ErrorStatus   generate		(const UcBrMesh2dFilter& meshFilter);
};


// Inline methods

inline
UcBrMesh2dFilter::UcBrMesh2dFilter() {}

inline
UcBrMesh2dFilter::~UcBrMesh2dFilter() {}

inline iterator
UcBrMesh2dFilter::insert(const value_type& x)
{ mKeyValuePair.first = x.first; mKeyValuePair.second = x.second; }


#endif
